/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jmenu.main;

import java.awt.Component;
import java.awt.Cursor;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author Roman
 */
public class MyDefaultTableCellPictureRenderer extends DefaultTableCellRenderer
{

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,boolean hasFocus, int row, int column)
        {
            JLabel label;
            label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
            
            if (label.getText().equals("-1"))
                label.setIcon(Icons.FOODIMAGE_UNSET);
            else
            {
                label.setIcon(Icons.FOODIMAGE_SET);
            }
            
            label.setText("");
            return label;
        }

}
